package bean;

import static javax.persistence.GenerationType.IDENTITY;

import java.util.Date;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;

import com.fasterxml.jackson.annotation.JsonIgnore;

/**
 * Panel generated by hbm2java
 */
@Entity
@Table(name = "panel", catalog = "bdd_dev_n_tiers")
public class Panel implements java.io.Serializable {

	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;
	private Integer id;
	private Flight flight;
	private String name;
	private Date hourOfDisplay;

	public Panel() {
	}

	public Panel(Integer id) {
		this.id = id;
	}

	public Panel(Flight flight, String name, Date hourOfDisplay) {
		this.flight = flight;
		this.name = name;
		this.hourOfDisplay = hourOfDisplay;
	}
	
	@Id
	@GeneratedValue(strategy = IDENTITY)
	@Column(name = "id", unique = true, nullable = false)
	public Integer getId() {
		return this.id;
	}

	public void setId(int id) {
		this.id = id;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "id_flight")
	public Flight getFlight() {
		return this.flight;
	}

	public void setFlight(Flight flight) {
		this.flight = flight;
	}

	@Column(name = "name", length = 50)
	public String getName() {
		return this.name;
	}

	public void setName(String name) {
		this.name = name;
	}

	@Temporal(TemporalType.TIMESTAMP)
	@Column(name = "hour_of_display", length = 0)
	public Date getHourOfDisplay() {
		return this.hourOfDisplay;
	}

	public void setHourOfDisplay(Date hourOfDisplay) {
		this.hourOfDisplay = hourOfDisplay;
	}

}
